package com.naiterui.ehp.bs.esign.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.esign.api.bjca.vo.SignUserParamVO;

/**
 * @author guoyongxiang
 * @date 2019/12/3 11:43
 * @since 1.0.0
 */
@FeignClient(name = "esignPharmacist", url = "${ehp.domain.pharmacist}", configuration = FeignConfiguration.class)
public interface IPharmacistFeignClient {

    /**
     * 回调用户审核结果
     *
     * @param userId
     * @param status
     * @param reason
     */
    @PostMapping("inner/esign/auth/result")
    void esignAuth(@RequestParam("userId") Long userId, @RequestParam("status") Integer status, @RequestParam("reason") String reason) throws BusinessException;

    /**
     * CA用户回写CA生成的签章图片
     * @param sealImage
     * @param pharmacistId
     * @throws BusinessException
     */
    @PostMapping("inner/esign/perfect/sealimage")
    void perfectSealImage(@RequestParam("sealImage") String sealImage, @RequestParam("pharmacistId") Long pharmacistId) throws BusinessException;

    @GetMapping("inner/user/getUserByPhone")
    SignUserParamVO getUserByPhone(@RequestParam String phone) throws BusinessException;
}
